#include <cstdio>

int main( )
{
    int c, n, p1, p2, p3;
    scanf("%d", &c);
    while ( c-- )
    {
        scanf("%d", &n);
        p1 = n / 2;
        p2 = ( n - p1 ) * 2 / 3;
        p3 = n - p1 - p2;
        p1 = p1 / 10 + ( p1 % 10 != 0 );
        p2 = p2 / 10 + ( p2 % 10 != 0 );
        p3 = p3 / 10 + ( p3 % 10 != 0 );
        printf("%d\n", p1 + p2 + p3);
    }
    return 0;
}
